<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<html>
<head>
<title>Department Management</title>
</head>
<link rel="stylesheet" href="../../../resources/css/fw-list.css"
	type="text/css">
<script src="../../../script/base.js"></script>
<script src="../../../script/list.js"></script>
<body bgcolor="white">
	<f:view>
		<f:loadBundle basename="net.orange.conf.lang.fw" var="msg" />
		<h:inputHidden value="#{department.datas.rowCount}" id="rowCount" />
		<h:form id="listForm">
			<table align="center" width="100%">
				<tr>
					<td><h:panelGrid columns="2" rowClasses="table-text-3"
							style="width:100%;">
							<h:panelGroup>
								<h:outputText value="#{msg.dept_code} :" />
								<h:inputText id="sr_dept_code"
									value="#{department.sr_dept_code}" />

								<h:outputText value="    " />

								<h:outputText value="#{msg.dept_name} :" />
								<h:inputText id="sr_dept_name"
									value="#{department.sr_dept_name}" />
							</h:panelGroup>

							<h:panelGroup style="text-align:right">
								<h:commandButton id="cmdSubmit" value="#{msg.common_summit}"
									onclick="searchInit()" action="#{department.search}"
									styleClass="button-normal" />

								<h:outputText value="    " />
								<h:commandButton id="cmdCancel" type="reset"
									value="#{msg.common_cancel}" styleClass="button-normal" />

								<h:outputText value="    " />
								<h:commandButton id="cmdNew" type="submit"
									value="#{msg.common_new}" action="#{department.create}"
									styleClass="button-normal" />
							</h:panelGroup>
						</h:panelGrid></td>
				</tr>
				<tr>
					<td>
						<hr>
					</td>
				</tr>
				<tr>
					<td class="content-message"><h:messages /></td>
				</tr>
				<tr>
					<td><h:dataTable id="table" value="#{department.datas}"
							styleClass="listing-table" var="the" rowClasses="table-text"
							headerClass="column-head">


							<h:column>
								<f:facet name="header">
									<h:outputText value="#{msg.dept_code}" />
								</f:facet>
								<h:outputText value="#{the.dept_code}" />
							</h:column>

							<h:column>
								<f:facet name="header">
									<h:outputText value="#{msg.dept_name}" />
								</f:facet>
								<h:outputText value="#{the.dept_name}" />
							</h:column>

							<h:column>
								<f:facet name="header">
									<h:outputText value="#{msg.dept_superior_dept_code}" />
								</f:facet>
								<h:outputText value="#{the.parent.dept_code}" />
							</h:column>

							<h:column>
								<f:facet name="header">
									<h:outputText value="#{msg.dept_superior_dept_name}" />
								</f:facet>
								<h:outputText value="#{the.parent.dept_name}" />
							</h:column>

							<h:column>
								<f:facet name="header">
									<h:outputText value="" />
								</f:facet>

								<h:commandButton id="cmdEdit" type="submit"
									value="#{msg.common_edit}" action="#{department.open}"
									styleClass="button-edit" />

								<h:outputText value=" " />

								<h:commandButton id="cmdCopy" type="submit"
									value="#{msg.common_copy}" action="#{department.copy}"
									styleClass="button-edit" />

								<h:outputText value=" " />

								<h:commandButton id="cmdDelete" type="submit"
									value="#{msg.common_delete}" action="#{department.delete}"
									onmousedown="return confirmDelete(this);"
									styleClass="button-delete" />
							</h:column>
						</h:dataTable></td>
				</tr>
				<tr>
					<td><h:panelGrid columns="1" rowClasses="table-text-3"
							style="width:100%;text-align:right">
							<h:panelGroup>
								<h:outputText
									value="#{msg.common_page}: #{department.pageLabel} " />

								<h:commandLink action="#{department.firstPage}"
									rendered="#{not department.firstPage}">
									<h:outputText value="#{msg.common_firstpage}| " />
								</h:commandLink>

								<h:commandLink action="#{department.previousPage}"
									rendered="#{not department.firstPage}">
									<h:outputText value="#{msg.common_perviouspage}| " />
								</h:commandLink>

								<h:commandLink action="#{department.nextPage}"
									rendered="#{not department.lastPage}">
									<h:outputText value="#{msg.common_nextpage}| " />
								</h:commandLink>

								<h:commandLink action="#{department.lastPage}"
									rendered="#{not department.lastPage}">
									<h:outputText value="#{msg.common_lastpage}" />
								</h:commandLink>
							</h:panelGroup>
						</h:panelGrid></td>
				</tr>
			</table>
		</h:form>
	</f:view>
</body>
</html>
